<template>
    <div>
        <h3>小三组件</h3>
        <div>金钱：100</div>
        <div>私房钱：{{money1}}</div>
        <button>买包-50</button>
        <button @click="fn">买手机-500</button>
    </div>
</template>

<script>
import { mapState } from 'vuex'
export default {
    data(){
        return{
            money:50,
        }
    },
    computed:{
        ...mapState({
            money1:'money'
        })
    },
    methods:{
        fn(){
            this.$store.dispatch('doHairAsync',500)
        }
    }
}
</script>

<style></style>
